<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">


    <h:head>

        <h:outputStylesheet library="css" name="style.css"/>   
        <f:metadata>  http-equiv="Content-Type" content="text/html; charset=UTF-8"</f:metadata>   
        <f:metadata>  name="description" content="Gestion d'utilisateurs" </f:metadata>
        <f:metadata>  http-equiv="Content-Language" content="fr" </f:metadata>
        <title>Gestionnaire de comptes</title>     
    </h:head>

    <h:body>




        <div id="entete">
            <table class="noStyle">
                <tr class="noStyle">
                    <td class="noStyle" width="60%">
                        <div class="titreAppli"><h1>Gestionnaire de comptes bancaires</h1></div>
                    </td>
                    <td class="noStyle" width="40%">
                        <img src="ressources/user.png" alt="logoUser" border="0" class="imgUser"/>
                    </td>
                </tr>
            </table>
        </div>

        <div id="centre">

            <h:form id="testeFormConnectPasOK" rendered="#{!compteBancaireBean.connectedAdmin and !compteBancaireBean.connectedUser}"> 
                <div id="centreleft">
                    <div id="content" class="left_content">
                        <div>
                            <fieldset>
                                <legend>Formulaire d'identification : </legend>

                                <h:body>
                                    <h:outputText rendered="#{!compteBancaireBean.connectedAdmin and !compteBancaireBean.connectedUser}" value="#{compteBancaireBean.message}" /> 

                                    <h:form id="loginForm" rendered="#{!compteBancaireBean.connectedAdmin and !compteBancaireBean.connectedUser}"> <br /><br />
                                        Login : <h:inputText id="loginForm" value="#{compteBancaireBean.login}" /> <br />
                                        Password : <h:inputText id="password" value="#{compteBancaireBean.password}" /> <br /><br />
                                    <h:commandButton value="Login" action="#{compteBancaireBean.checkLogin}" /> 
                                    </h:form> 

                                    <h:form id="deconnexionForm" rendered="#{compteBancaireBean.connectedAdmin || compteBancaireBean.connectedUser}"> 
                                        <h:outputText  value="#{compteBancaireBean.message}" />
                                        <h:commandButton value="Deconnexion" action="#{compteBancaireBean.deconnexion}" /> 
                                    </h:form> 

                                </h:body>

                            </fieldset>


                        </div> 
                    </div>  
                </div>
            </h:form> 

            <h:form id="testeFormConnectOKadmin" rendered="#{compteBancaireBean.connectedAdmin}"> 
                <div id="centreLeft">
                    <center><h2><h:outputText value="Menu d'admin"/></h2></center>
                    <ul>
                        <li><h:commandLink action="#{compteBancaireBean.afficherLesUtilisateurs()}" value="Afficher les utilisateurs"/> </li>
                        <li><h:commandLink action="#{compteBancaireBean.afficherComptesBancaires()}" value="Afficher les comptes bancaires"/> </li>
                    </ul>    
                </div>
                
                <div id="centreRight">
                    <div id="content" class="left_content">
                        <center><h2><ui:insert name="complementTitreEtH1"/>#{numEx}</h2></center>  
                        <ui:insert name="content">Content</ui:insert>  
                    </div>  
                </div>
            </h:form>

            <h:form id="testeFormConnectOKuser" rendered="#{compteBancaireBean.connectedUser}"> 
                <div id="centreLeft">
                    <center><h2><h:outputText value="Menu d'utilisateur"/></h2></center>
                    <ul>
                        <li><h:commandLink action="#{compteBancaireBean.afficherComptesBancairesUser()}" value="Afficher vos comptes bancaires"/> </li>                                     
                    </ul>    
                </div>

                <div id="centreRight">
                    <div id="content" class="left_content">
                        <center><h2><ui:insert name="complementTitreEtH1"/>#{numEx}</h2></center>  
                        <ui:insert name="content">Content</ui:insert>  
                    </div>  
                </div>
            </h:form>
            
            
        </div>
    </h:body> 

    <br />
    
    <center>
        <h:form id="deconnexionForm" rendered="#{compteBancaireBean.connectedAdmin || compteBancaireBean.connectedUser}"> 
            <div style="font-size: 10px; color:#424242; align:left;"><h:outputText  value="#{compteBancaireBean.message}"/></div><br />
            <h:commandButton value="Deconnexion" action="#{compteBancaireBean.deconnexion}" /> 
        </h:form>
    </center>
    
</html>







